/**
 * 
 */
package com.scpii.universal.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.scpii.universal.hibernate.dao.BaseDao;
import com.scpii.universal.hibernate.entity.ViewContentAttributeTab;
import com.scpii.universal.hibernate.intface.BaseInterface;
import com.scpii.universal.util.SpringBeanFactory;

/**
 * UniversalApi
 * @author 甘建新
 * 2012-7-25下午10:36:38
 */
public class ViewContentAttributeTabService implements BaseInterface<ViewContentAttributeTab> {
	private static final Logger log = LoggerFactory.getLogger(ViewContentAttributeTabService.class);
	
//	private BaseDao<ViewContentAttributeTab> viewContentAttributeTabDao = SpringBeanFactory.viewContentAttributeTabBeanDao;
	private BaseDao<ViewContentAttributeTab> viewContentAttributeTabDao;

	public ViewContentAttributeTab get(Integer id) throws Exception {
		return viewContentAttributeTabDao.get(id);
	}

	public List<ViewContentAttributeTab> getAll() throws Exception {
		return viewContentAttributeTabDao.getAll();
	}

	public ViewContentAttributeTab get(String propertyName, Object value) throws Exception {
		return null;
	}

	public List<ViewContentAttributeTab> getList(String propertyName, Object value)
			throws Exception {
		return null;
	}

	public Long getTotalCount() throws Exception {
		return null;
	}

	public void save(ViewContentAttributeTab obj) throws Exception {
		viewContentAttributeTabDao.save(obj);
	}

	public void update(ViewContentAttributeTab obj) throws Exception {

	}

	public void delete(ViewContentAttributeTab obj) throws Exception {

	}

	public void delete(Integer id) throws Exception {

	}

	public List<ViewContentAttributeTab> hqlGetList(String hql, Map<String, Object> argsMap)
			throws Exception {
		return viewContentAttributeTabDao.hqlGetList(hql, argsMap);
	}

	public void hqlUpdate(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		viewContentAttributeTabDao.hqlUpdate(namedHqlQuery, argsMap);
	}

	public Long hqlGetNums(String namedHqlQuery, Map<String, Object> argsMap)
			throws Exception {
		return viewContentAttributeTabDao.hqlGetNums(namedHqlQuery, argsMap);
	}

	public List<ViewContentAttributeTab> sqlGetList(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return viewContentAttributeTabDao.sqlGetList(sqls, argsMap);
	}

	public void sqlUpdate(String sqls, Map<String, Object> argsMap)
			throws Exception {
		viewContentAttributeTabDao.sqlUpdate(sqls, argsMap);
	}

	public Long sqlGetNum(String sqls, Map<String, Object> argsMap)
			throws Exception {
		return viewContentAttributeTabDao.sqlGetNum(sqls, argsMap);
	}
	
	/**
	 * 根据视图ID，获得内容在视图上显示的属性列表
	 * @param viewId
	 * @return
	 * @throws Exception
	 * @author 甘建新
	 * 2012-7-25下午10:40:37
	 */
	public List<ViewContentAttributeTab> getViewContentAttributeList(int viewId)throws Exception{
		if (viewId>0) {
			Map<String, Object> argsMap = new HashMap<String, Object>();
			argsMap.put("viewId", viewId);
			return this.hqlGetList("GET_ATTRIBUTE_BY_VIEWID", argsMap);
		}
		return null;
	}

	//Setter
	public void setViewContentAttributeTabDao(
			BaseDao<ViewContentAttributeTab> viewContentAttributeTabDao) {
		this.viewContentAttributeTabDao = viewContentAttributeTabDao;
	}
	
}
